* Add a waypoint that we've already written out to our list
*
*/
-void
+static void
gdb_add_to_hidden(const waypoint *wpt)
{
waypoint *tmp = waypt_dupe(wpt);
route_add_wpt(gdb_hidden, tmp);
}
-waypoint *
+static waypoint *
gdb_find_wpt_q_by_name(const queue *whichQueue, const char *name)
{
queue *elem, *tmp;
return NULL;
}
-const char *
+static const char *
gdb_find_desc_from_icon_number(const int icon, garmin_formats_e garmin_format)
{
static char custom[] = "Custom 63";
return DEFAULTICONDESCR;
}
-int
+static int
gdb_find_icon_number_from_desc(const char *desc, garmin_formats_e garmin_format)
{
icon_mapping_t *i;
return def_icon;
}
-int
+static int
gdb_detect_rtept_class(const waypoint *wpt)
{
if (gdb_find_wpt_q_by_name((queue *)&gdb_hidden->waypoint_list, wpt->shortname) == NULL)
#ifndef UTF8_SUPPORT
-char *gdb_garmin_to_utf8(const char *s)
+static char *gdb_garmin_to_utf8(const char *s)
{
int len;
char *res;
/* %%% local functions (read support) %%% */
-char *
+static char *
gdb_convert_name_buff(char *buff, size_t buffsize)
{
#ifdef UTF8_SUPPORT
}
#endif
-waypoint *
+static waypoint *
gdb_create_rte_wpt(const char *name, double lat, double lon, double alt)
{
waypoint *wpt;
return wpt;
}
-size_t
+static size_t
gdb_fread(void *target, size_t size)
{
size_t result;
return result;
}
-int
+static int
gdb_fread_str(char *dest, size_t maxlen)
{
int c;
fatal(MYNAME ": local buffer overflow detected, please report!\n");
}
-int
+static int
gdb_fread_le(void *dest, size_t size, int bit_count, const char *prefix, const char *field)
{
char buff[32];
}
}
-int
+static int
gdb_fread_flag(const char value) /* read one byte and compare to value */
{
char c;
return (c == value);
}
-void
+static void
gdb_is_valid(int is, const char *prefix, const char *comment)
{
if (is == 0)
}
}
-void
+static void
gdb_is_validf(int is, const char *prefix, const char *format, ...)
{
va_list args;
/* %%% read file header */
/********************************************************************************************************/
-void
+static void
gdb_read_file_header(void)
{
char buff[128];
/* %%% read waypoint */
/********************************************************************************************************/
-waypoint *
+static waypoint *
gdb_read_wpt(const size_t fileofs, int *wptclass)
{
char xname[GDB_NAME_BUFFERLEN];
/* %%% read route */
/********************************************************************************************************/
-route_head *
+static route_head *
gdb_read_route(void)
{
char xname[GDB_NAME_BUFFERLEN];
}
-route_head *
+static route_head *
gdb_read_track(const size_t max_file_pos)
{
char xname[GDB_NAME_BUFFERLEN];
/*******************************************************************************/
-void
+static void
gdb_read_data(void)
{
int reclen, warnings;
/* helpers */
-waypoint **
+static waypoint **
gdb_route_point_list(const route_head *route, int *count)
{
waypoint **result;
return result;
}
-void
+static void
gdb_fwrite(const void *data, const size_t size)
{
fwrite(data, size, 1, fout);
}
-void
+static void
gdb_fwrite_str(const char *str, const int len)
{
}
}
-void
+static void
gdb_fwrite_le(const void *data, const size_t size)
{
int i;
}
}
-void
+static void
gdb_fwrite_alt(const double alt, const double unknown_value)
{
char c0 = 0;
gdb_fwrite(&c0, 1); /* no value */
}
-void
+static void
gdb_fwrite_int(const int data)
{
gdb_fwrite_le(&data, sizeof(data));
}
-void
+static void
gdb_fwrite_icon(const waypoint *wpt) /* partly taken from mapsource.c */
{
int icon;
/* %%% write file header %%% */
/*-----------------------------------------------------------------------------*/
-void
+static void
gdb_write_file_header(const struct tm *tm)
{
char buff[128];
/* %%% write waypoints %%% */
/*-----------------------------------------------------------------------------*/
-void
+static void
gdb_write_waypt(const waypoint *wpt, const int hidden)
{
int i;
/* %%% write routes %%% */
/*-----------------------------------------------------------------------------*/
-void
+static void
gdb_write_route(const route_head *route, const waypoint **list, const int count)
{
int i, wpt_class;
/* %%% write tracks %%% */
/*-----------------------------------------------------------------------------*/
-void
+static void
gdb_write_track(const route_head *track)
{
char buff[128];
/*******************************************************************************/
-void
+static void
gdb_write_data(void)
{
char c1 = 1;
/*******************************************************************************/
-void
+static void
gdb_init_opts(const char op) /* 1 = read; 2 = write */
{
gdb_via = 0;
{ NULL, 0, NULL}
};
-void
+static void
hiketech_rd_init(const char *fname)
{
xml_init(fname, ht_map, NULL);
fprintf(ofd, "</trk>\n");
}
-void
+static void
hiketech_print_utc(time_t tm, const char *indent, const char *tag)
{
char tbuf[80];
fprintf(ofd, "</wpt>\n");
}
-void
+static void
hiketech_write(void)
{
fprintf(ofd, "<hiketech version=\"1.2\" url=\"http://www.hiketech.com\">\n");
fprintf(ofd, "</hiketech>\n");
}
+static
void ht_wpt_s(const char *args, const char **unused)
{
wpt_tmp = waypt_new();
}
+static
void ht_ident(const char *args, const char **unused)
{
wpt_tmp->shortname = xstrdup(args);
}
+static
void ht_sym(const char *args, const char **unused)
{
wpt_tmp->icon_descr = xstrdup(args);
wpt_tmp->wpt_flags.icon_descr_is_dynamic = 1;
}
+static
void ht_lat(const char *args, const char **unused)
{
wpt_tmp->latitude = atof(args);
}
+static
void ht_long(const char *args, const char **unused)
{
wpt_tmp->longitude = atof(args);
}
+static
void ht_alt(const char *args, const char **unused)
{
wpt_tmp->altitude = atof(args);
}
+static
void ht_wpt_e(const char *args, const char **unused)
{
waypt_add(wpt_tmp);
wpt_tmp = NULL;
}
+static
void ht_trk_s(const char *args, const char **unused)
{
trk_head = route_head_alloc();
track_add_head(trk_head);
}
+static
void ht_trk_e(const char *args, const char **unused)
{
}
+static
void ht_trk_ident(const char *args, const char **unused)
{
trk_head->rte_name = xstrdup(args);
}
+static
void ht_trk_pnt_s(const char *args, const char **unused)
{
wpt_tmp = waypt_new();
}
+static
void ht_trk_pnt_e(const char *args, const char **unused)
{
route_add_wpt(trk_head, wpt_tmp);
}
+static
void ht_trk_utc(const char *args, const char **unused)
{
struct tm tm;
wpt_tmp->creation_time = utc;
}
+static
void ht_trk_lat(const char *args, const char **unused)
{
wpt_tmp->latitude = atof(args);
}
+static
void ht_trk_long(const char *args, const char **unused)
{
wpt_tmp->longitude = atof(args);
}
+static
void ht_trk_alt(const char *args, const char **unused)
{
wpt_tmp->altitude = atof(args);
#define MY_CBUF 4096
#if NO_EXPAT
-void
+static void
nav_rd_init(const char *fname)
{
fatal(MYNAME ": This build excluded GPX support because expat was not installed.\n");
}
-void
+static void
nav_read(void)
{
}
#else
-struct
+static struct
nc_type_mapping{
geocache_type type;
const char *name;
{ gt_event, "event" }
};
-struct
+static struct
nc_container_mapping{
geocache_container type;
const char *name;
{
}
-void
+static void
nav_rd_init(const char *fname)
{
fd = xfopen(fname, "r", MYNAME);
XML_SetElementHandler(psr, nav_start, nav_end);
}
-void
+static void
nav_read(void)
{
int len;
#endif
-void
+static void
nav_rd_deinit(void)
{
fclose(fd);
}
-void
+static void
nav_wr_init(const char *fname)
{
fatal(MYNAME ": Does not support writing Navicache files.\n");
ofd = xfopen(fname, "w", MYNAME);
}
-void
+static void
nav_wr_deinit(void)
{
fclose(ofd);
}
-void
+static void
nav_write(void)
{
}
/*----------------------------------------------*/
+static
void ovl_rd_init(char const *fname)
{
fpin = xfopen(fname, "rt", MYNAME);
} *groups;
static int groups_cnt;
-void ovl_add_group(int aktgrp,char *akttxt)
+static void ovl_add_group(int aktgrp,char *akttxt)
{
int i;
/*
The name of route is stored in a 'Text'-symbol with identical 'Group'-number.
*/
-void route_add_name(const route_head *hd)
+static void route_add_name(const route_head *hd)
{
int grp;
int i;
strcpy(route->rte_name,name);
}
-void ovl_read(void)
+static void ovl_read(void)
{
char line[MAXLINE];
int isSection;
xfree(groups);
}
-void ovl_rd_deinit(void)
+static void ovl_rd_deinit(void)
{
fclose(fpin);
}
}
}
-void ovl_wr_init(const char *fname)
+static void ovl_wr_init(const char *fname)
{
fpout = xfopen(fname, "wt", MYNAME);
govl_sum_n = 0.0;
}
}
-void ovl_wr_deinit(void)
+static void ovl_wr_deinit(void)
{
fprintf(fpout,"[Overlay]\n");
fprintf(fpout,"Symbols=%d\n",govl_symbol_cnt);
fclose(fpout);
}
-void symbol_init(const route_head *hd)
+static void symbol_init(const route_head *hd)
{
fprintf(fpout,"[Symbol %d]\n",govl_symbol_cnt+1);
fprintf(fpout,"Typ=3\n"); // Linie
govl_group_cnt++;
}
-void symbol_text(double east,double north,char *text,int group)
+static void symbol_text(double east,double north,char *text,int group)
{
fprintf(fpout,"[Symbol %d]\n",govl_symbol_cnt+1);
fprintf(fpout,"Typ=2\n"); // Text
govl_symbol_cnt++;
}
-void symbol_point(const waypoint *wpt)
+static void symbol_point(const waypoint *wpt)
{
double east,north;
}
-void symbol_deinit(const route_head *hd)
+static void symbol_deinit(const route_head *hd)
{
queue *elem, *tmp;
waypoint *waypointp;
}
-void ovl_write(void)
+static void ovl_write(void)
{
waypt_disp_all(overlay_waypt_pr);
track_disp_all(symbol_init, symbol_deinit, symbol_point);
* utilities
*/
+static
char *ppdb_strcat(char *dest, char *src, char *def, int *size)
{
int len;
static size_t str_pool_s[STR_POOL_SIZE];
static int str_poolp = -1;
+static
void str_pool_init(void)
{
int i;
}
}
+static
void str_pool_deinit(void)
{
int i;
}
}
+static
char *str_pool_get(size_t size)
{
char *tmp;
return tmp;
}
+static
char *str_pool_getcpy(char *src, char *def)
{
char *res;
* decoding/formatting functions
*/
+static
char *ppdb_fmt_float(const double val)
{
char *str = str_pool_get(32);
return str;
}
+static
char *ppdb_fmt_degrees(char dir, double val)
{
char *str = str_pool_get(32);
return str;
}
+static
double ppdb_decode_coord(const char *str)
{
double val;
return val;
}
+static
int ppdb_decode_tm(char *str, struct tm *tm)
{
int msec, d1, d2, d3, d4;
return 1;
}
-static int ppdb_read_wpt(const struct pdb *pdb_in, const struct pdb_record *pdb_rec, route_head *head)
+static
+int ppdb_read_wpt(const struct pdb *pdb_in, const struct pdb_record *pdb_rec, route_head *head)
{
char *data, *str;
double altfeet;
};
/* Taken from PsiTrex 1.13 */
+static
const psit_icon_mapping_t psit_icon_value_table[] = {
{ 0x00, "anchor" },
{ 0x06, "dollar" },
{ -1, NULL }
};
-const char *
+static const char *
psit_find_desc_from_icon_number(const int icon)
{
const psit_icon_mapping_t *i;
return "";
}
-int
+static int
psit_find_icon_number_from_desc(const char *desc)
{
const psit_icon_mapping_t *i;
* helpers
*******************************************************************************/
-int
+static int
trackfilter_opt_count(void)
{
int res = 0;
return res;
}
-int
+static int
trackfilter_parse_time_opt(const char *arg)
{
time_t t0, t1;
* track title producers
*******************************************************************************/
-void
+static void
trackfilter_split_init_rte_name(route_head *track, const time_t time)
{
char buff[128], tbuff[128];
track->rte_name = xstrdup(buff);
}
-void
+static void
trackfilter_pack_init_rte_name(route_head *track, const time_t default_time)
{
char buff[128];
* option "title"
*******************************************************************************/
-void
+static void
trackfilter_title(void)
{
int i;
* option "pack" (default)
*******************************************************************************/
-void
+static void
trackfilter_pack(void)
{
int i, j;
* option "merge"
*******************************************************************************/
-void
+static void
trackfilter_merge(void)
{
int i, j, dropped;
* option "split"
*******************************************************************************/
-void
+static void
trackfilter_split(void)
{
route_head *curr;
* option "move"
*******************************************************************************/
-void
+static void
trackfilter_move(void)
{
int i;
* option: "start" / "stop"
*******************************************************************************/
-time_t
+static time_t
trackfilter_range_check(const char *timestr)
{
int i;
return mkgmtime(&time);
}
-int
+static int
trackfilter_range(void) /* returns number of track points left after filtering */
{
time_t start, stop;